const inquirer = require('inquirer')
const downloadFn = require('./download')
const config = require('../../config')

const myaction = async (project, args) => {
  // mycli create a b c
  // console.log(project) // a
  // console.log(args) // ['b', 'c']
  const answer = await inquirer.prompt([
    {
      type: 'list',
      name: 'framework',
      choices: config.framework,
      message: '请选择你所使用的框架',
    },
  ])

  downloadFn(config.frameworkUrl[answer.framework], project)
}

module.exports = myaction
